package com.csgc.camera.broad

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.widget.Toast
import com.csgc.camera.events.TimeChangeEvent
import com.drake.channel.sendEvent


class TimeChangeReceiver : BroadcastReceiver(){
    override fun onReceive(context: Context, intent: Intent) {
        when (intent.action) {
            Intent.ACTION_TIME_TICK -> {
                //每过一分钟 触发
                sendEvent(TimeChangeEvent(0))
            }

            Intent.ACTION_TIME_CHANGED ->{
                //设置了系统时间
                sendEvent(TimeChangeEvent(0))
            }


        }
    }
}